import {ProColumns, ProTableProps} from '@ant-design/pro-components/es';
import {GModalFormProps} from '../ModalForm';
import {ButtonProps} from 'antd/lib/button/button';

export interface GTableSchema extends ProTableProps<any, any> {
  data?: {
    url?: string;
    method?: string;
    include?: string[];
    sort?: string[];
    filter?: any;
  };
  action?: {
    toolbar?: {
      add?: GModalFormProps | boolean;
      delete?: ButtonProps | boolean;
      excelExport?: ButtonProps | boolean;
      excelImport?: ButtonProps | boolean;
    };
    row?: {
      edit?: GModalFormProps | boolean;
      editVisible?: (record: any) => boolean;
      delete?: ButtonProps | boolean;
      deleteVisible?: (record: any) => boolean;
      props?: ProColumns;
      render?: (record: any) => React.ReactNode[];
    };
    idGetter?: {
      editId?: (record: any) => any;
      deleteId?: (record: any) => any;
    }
  };
}
